package com.syh.jn.scm.domain.supplier.repository.purchase;

import cn.redscarf.commons.wrapper.Wrapper;
import com.syh.core.ddd.infrastructure.repository.ReadRepo;
import com.syh.jn.scm.domain.supplier.entity.purchase.PurchaseOrder;
import com.syh.jn.scm.domain.supplier.entity.purchase.PurchaseOrderItem;
import com.syh.jn.scm.dto.supplier.purchase.PurStatisticalAmountVo;

import java.util.List;

public interface PurchaseOrderReadRepository extends ReadRepo<PurchaseOrder, Long> {
  boolean purItemExistsById(String column, Long id);

  /**
   * 根据所属id查找明细
   *
   * @param purchaseOrderId
   * @return
   */
  <T> List<T> getItemsByPurchaseOrderId(Long purchaseOrderId);

  <T> T getItemByItemId(Long orderItemId);
  /**
   * 根据所属id查找明细
   *
   * @param purchaseOrderIds
   * @return
   */
  <T> List<T> getItemsByPurchaseOrderIds(Long[] purchaseOrderIds);

  /**
   * 根据商品id拿到订单明细商品
   *
   * @param goodsId
   * @param id
   * @return
   */
  <T> T getByGoodsId(Long goodsId, Long id);


  /**
   * 采购统计金额
   *
   * @param wrapper
   * @return
   */
  <T> T statisticalAmount(Wrapper wrapper);

  <T> T  statisticalAmountByOrder(Wrapper we);
}
